import * as React from "react";
import style from "./style.module.css";
import { IRecruit } from "../../types";
import { Link } from "react-router-dom";

interface Props {
  item: IRecruit;
}
// 相似职位列表项
export default function JobItem(props: Props) {
  return (
    <Link
      to={"/recruit/" + props.item._id}
      className={style.jobs}
      onClick={() => {
        window.scrollTo(0, 0);
      }}
    >
      <div>
        <img
          src={props.item.companys[0]?.logo}
          alt=""
          className={style.joblogo}
        />
      </div>
      <div className={style.jobinfo}>
        <div>
          <span className={style.jobtitle}>{props.item.positionName}</span>{" "}
          <span className={style.salary2}>
            {props.item.salary.min}-{props.item.salary.max}k
          </span>
        </div>
        <p className={style.box}>
          <span className={style.black}>
            {props.item.companys[0]?.companyShortName}
            <em className={style.vdot}></em>
            {props.item.city}
          </span>
          <span className={style.button}>立即沟通</span>
        </p>
      </div>
    </Link>
  );
}
